home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / exec / funshr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  682 b   |  34 lines

  1. /*
  2. \funcref{fun\_shr}{void fun\_shr ()}
  3.     {}
  4.     {}
  5.     {pop(), push(), error()}
  6.     {}
  7.     {funshr.c}
  8.     {
  9.         This function pops two variables and pushes the shift-right result of 
  10.         the {\em vu.intval} fields of these variables.  The resulting pushed 
  11.         variable is of type {\em e\_int}.  
  12.  
  13.         It is assumed that the left argument of the expression was pushed 
  14.         first; therefore, the right argument is popped first. 
  15.         
  16.     } 
  17. */ 
  18.  
  19. #include "icm-exec.h"
  20.  
  21. void fun_shr ()
  22. {
  23.     VAR_
  24.         tmp;
  25.     int
  26.         rvalint;
  27.  
  28.     tmp.type = e_int;
  29.     rvalint = pop ().vu.intval;
  30.     tmp.vu.intval = pop().vu.intval >> rvalint;
  31.  
  32.     push (tmp);
  33. }
  34.